The present invention relates to devices and methods that buffers messages, internal as well as external messages, in connection with messages sent between processes, modules etc, and in particular to protection of a message buffer, working according to the first-in-first-out principle, against overloading.
A digital system comprises different digital units, e.g. processors, which are communicating with each other and which comprises hardware and software. Most processors can only perform one thing at a time, why the software part of the units realises several functions. The functions are normally split into modules, which communicates by sending messages to each other. Some modules are common for several functions, which makes it necessary to queue messages, since they can not operate simultaneously. This is generally achieved by putting them into buffers. Furthermore a function can often be run in several copies (processes) in parallel, which also makes it necessary to queue messages, i.e. put them in buffers. In the field of telephony, several calls can be set up simultaneously.
A buffer may be arranged in different manners. An often used way is that the buffer stores the incoming messages in consecutive order, and the first message entered into the buffer becomes the first message which is forwarded. This first-in-first-out method is common in most processor communication. A buffer has a certain storage capacity. If a buffer has a storage capacity of a certain number of messages from a specific module, the buffer may be overloaded, if the difference between incoming. messages to the buffer and outgoing messages from the buffer becomes larger than the number of storable messages.
In the Japanese patent application JP 62/185435, a method is disclosed, in which a sending unit sets a flag. No further sending is performed before the flag is removed. This is done when the message has left a common sending buffer.
In the patent U.S. Pat. No. 5,412,651, a queue handling method is disclosed, in which each sending unit is assigned a predefined number of time slots. Each unit keeps queue and count down counters for monitoring the number of pending packets.
In the U.S. Pat. No. 4,887,076, a method is illustrated, which informs a sending unit about placing a message in a queue. A disadvantage with the above mentioned solutions is that they all rely on a dedicated communication between the units or modules and the buffer. Such message handling sent to and from the buffer mechanism to the user of the buffer stops or slows down the actual sending of messages. Thus, such solutions may work very well but it can be hard to get an effect quick enough.
Another used approach is time supervision. Time supervision is performed by the user, and implies that the intensity of messages is reduced to the available capacity of the receivers. However, this may in many cases cause more processor load. Furthermore, the maximum allowed intensity has to be equal to the minimum capacity of the mechanism emptying the buffer.
Another a procedure used in prior art uses a control message, going forth and back between the unit and the buffer. The control message which is sent back to the unit itself, is sent as a last message in a batch of messages of the same number as the buffer may contain. Further sending is prohibited until the control message is received. This method has the disadvantage that the buffer capacity is used inefficiently, since the buffer has to be totally emptied, before any new messages can be sent. The prohibition of sending messages is activated for short periods also when the overall traffic intensity is low.
An object of the present invention is to achieve a buffer protection device and method, which do not have the above mentioned disadvantages. Thus a system in which no separate buffer notification mechanism is included is requested. Furthermore, another object of the invention is to achieve a device and method which are flexible enough to be usable in systems of different capacity.
The above objects are accomplished by a method and devices according to the independent claims. An overflow protection buffer method according to the present invention in a digital unit, which comprises a number of digital modules connected to a message buffer of a first-in-first-out type, able to store a first number x of messages from a first one of said digital modules, is characterised by creating and sending pace messages to the buffer from the first digital module addressed to the first unit itself and keep track of the pace in which they are sent and received back. A pace criterion for sending pace messages and a halt criterion for halting message sending to the buffer are used to insure that less than or equal to x messages are present in the buffer. Said criteria also admits more than one pace message to be present in the buffer simultaneously.
A digital unit including or a module connected to a message buffer of a first-in-first-out type and able to store a first number x of messages from the digital module comprises according to the present invention means for creating a pace message, addressed to the digital module itself, a pace sender for sending the pace message from the digital module to the message buffer when a pace criterion is fulfilled, a receiver for receiving the pace message from the message buffer; and means for halting the process of sending messages from the digital module to the message buffer if a halt criterion is fulfilled.